import request from './request'

const getAllUsers = () => request.get('/admin/all-users')

const addUser = ({ userName, loginPwd } = {}) =>
  request.post('/admin/add-user', { userName, loginPwd })

const modifyUser = ({ id, userName, loginPwd } = {}) =>
  request.put('/admin/modify-user', { id, userName, loginPwd })

const deleteUser = (id) => request.delete(`/admin/delete-user/${id}`)

const offlineUser = (id) => request.put('/admin/offline-user', { id })

export { getAllUsers, addUser, modifyUser, offlineUser, deleteUser }
